import Utils from "@/utils/index.js"
import eventActionDefinitions from "@/components/main/eventActionDefinitions.js"

const configJson = require("../../pluginTemp/config.json")
export default {
  data() {
    return {}
  },
  props: {
    vueProps: Object
  },
  mounted() {
    const { componentId } = this.vueProps
    window.componentCenter?.register(componentId, "comp", this, eventActionDefinitions)
  },
  methods: {
    Event_Center_getName() {
      const requirementNumber = configJson["requirement-number"]
      return this.vueProps.customConfig.id || requirementNumber || Utils.generateUUID()
    },
  },
  beforeDestroy() {
    window.componentCenter?.removeInstance(this.vueProps.componentId)
  }
}